from typing import Optional, Union

from pydantic import BaseModel, Field


class Req(BaseModel):
    name: str = Field(description='名字')
    detail: Optional[str] = Field(description='详情')


class Create(BaseModel):
    name: str = Field(description='名字')
    path_name: str = Field(description='路径名字')
    type: Optional[int] = Field(description='类型', default=1)
    image: Optional[str] = Field(description='图片')
    detail: Optional[str] = Field(description='详情')


class Res(BaseModel):

    id: int = Field(description='ID')
    name: str = Field(description='名字')
    detail: str = Field(description='详情')
    image: str = Field(description='图片')


class Del(BaseModel):
    id: list[int] = Field(description='ID列表', default=[])


class Update(BaseModel):

    name: Optional[str] = Field(description='名字')
    image: Optional[str] = Field(description='图片')
    detail: Optional[str] = Field(description='详情')
    path_name:  Optional[str] = Field(description='路径名字')
    type: Optional[int] = Field(description='类型')




